import request from '@/utils/request'
/**
 * 获取菜单列表
 * ***/
export function getMenuslistApi() {
    return request({
        url: '/menus',
        method: 'GET'

    })
}
/**
 * 修改菜单列表
 * @param {boolean} isPoint 是否权限点
 * @param {integer} pid 父亲id
 * @param {string} code 菜单代码
 * @param {string} title 菜单标题
 * ***/
export function getEditmenusApi(id, is_point, pid, code, title) {
    return request({
        url: `/menus/${id}`,
        method: 'PUT',
        data: {
            id,
            is_point,
            pid,
            code,
            title
        }
    })
}
/**
 * 菜单详情 做数据回显
 * @param {string} pid 父亲id
 * ***/
export function getMenusApi(id) {
    return request({
        url: `/menus/${id}`,
        method: 'GET'
    })
}

/**
 * 删除菜单
 * @param {string} pid 父亲id
 * ***/
export function getDeletmenusApi(id) {
    return request({
        url: `/menus/${id}`,
        method: 'DELETE'
    })
}
/**
 * 添加菜单
* @param {boolean} isPoint 是否权限点
 * @param {integer} pid 父亲id
 * @param {string} code 菜单代码
 * @param {string} title 菜单标题
 * ***/
export function getAddmenusApi(is_point, pid, code, title) {
    return request({
        url: '/menus',
        method: 'POST',
        data: {
            is_point,
            pid,
            code,
            title
        }
    })
}
/**
 * 获取权限组
 * ***/
export function getPermissionlistApi() {
    return request({
        url: '/permissions/simple',
        method: 'GET'

    })
}

